package com.ltkj.system.api;

import com.ltkj.common.core.constant.ServiceNameConstants;
import com.ltkj.common.core.domain.R;
import com.ltkj.common.core.web.domain.AjaxResult;
import com.ltkj.system.api.domain.AppletOrderDetailVo;
import com.ltkj.system.api.domain.OrderDetailQueryDTO;
import com.ltkj.system.api.domain.TicOrder;
import com.ltkj.system.api.factory.RemoteOrderFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 订单服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteOrderService", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = RemoteOrderFallbackFactory.class)
public interface RemoteOrderService
{
    /*
     * @description:支付查询订单信息
     * @author: gushaoliang 
     * @date: 2023/9/13 15:18
     * @param: [orderId]
     * @return: com.ltkj.common.core.web.domain.AjaxResult
     **/
    @GetMapping(value = "/order/wxPayOrder/{orderId}")
    public R<TicOrder> getWxPayInfo(@PathVariable("orderId") Long orderId);

    @GetMapping(value = "/order/orderPayDetail/{wxOrdernum}")
    public R<TicOrder> orderPayDetail(@PathVariable("wxOrdernum") String wxOrdernum);
    @GetMapping(value = "/order/orderPayOrderIdDetail/{orderId}")
    public R<TicOrder> orderPayOrderIdDetail(@PathVariable("orderId") Long orderId);
    @ApiOperation("退款后退还库存及修改状态")
//    @RequiresPermissions("order:order:paydetail")
    @GetMapping(value = "/order/orderBack/{orderId}")
    public AjaxResult orderBack(@PathVariable("orderId") Long orderId);

    /*
     * @description:退款中状态修改
     * @author: gushaoliang
     * @date: 2023/9/19 8:35
     * @param: [orderId]
     * @return: com.ltkj.common.core.web.domain.AjaxResult
     **/
    @GetMapping(value = "/order/refundOrderStatus/{orderId}")
    public AjaxResult refundOrderStatus(@PathVariable("orderId") Long orderId);

    /*
     * @description:根据业务主键和类型查询订单详情
     * @author: liupf
     * @date: 2023/9/26
     **/
    @PostMapping(value = "/details/info")
    R<List<AppletOrderDetailVo>> queryOrderDetail(@RequestBody OrderDetailQueryDTO queryDTO);
}
